package com.xinxin.facelinker.activity;

import android.app.Activity;
import android.content.Intent;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ImageView;
import android.widget.TextView;

import com.easemob.chatuidemo.R;
import com.google.zxing.WriterException;
import com.xinxin.facelinker.Config;
import com.xinxin.facelinker.QRcode.CaptureActivity;
import com.xinxin.facelinker.QRcode.encoding.EncodingHandler;

public class ScanQRcodeActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = new Intent(ScanQRcodeActivity.this, CaptureActivity.class);
        startActivityForResult(intent, 0);

    }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);
        if (resultCode == RESULT_OK) {
            String result = data.getExtras().getString("result");
            Intent intent=new Intent(ScanQRcodeActivity.this,SendNewPalMessageActivity.class);
            intent.putExtra(Config.KEY_OTHER_ACCOUNT_NUM,result);
            startActivity(intent);
            finish();
        }
    }
}
